package com.tiancheng.trade.payment.service;

import com.tiancheng.trade.commom.core.data.PageInfo;
import com.tiancheng.trade.payment.model.SettleFile;
import com.tiancheng.trade.payment.task.ums.bo.SettleFileBo;
import com.tiancheng.trade.payment.vo.admin.SettleFileQueryVo;
import com.tiancheng.trade.payment.vo.admin.res.SettleFileResVo;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;
import java.util.List;
import java.util.Set;

/**
 * @author kellen
 * @date 2024-12-09 16:53
 */
public interface SettleFileService {

    /**
     * 清分文件记录查询
     *
     * @param fileNames 清分文件名称
     * @return
     */
    List<SettleFile> findByFileNames(Set<String> fileNames);

    /**
     * 保存划付结果
     *
     * @param settleFileBos
     * @return
     */
    int saveSettleApprRet(List<SettleFileBo> settleFileBos);

    int save(SettleFile settleFile);

    /**
     * 查询清分列表
     * @param settleFileQueryVo
     * @return
     */
    PageInfo<SettleFileResVo> findList(SettleFileQueryVo settleFileQueryVo);

    /**
     * 导出清分明细
     * @param settleFileQueryVo
     * @param response
     * @return
     */
    void exportList(SettleFileQueryVo settleFileQueryVo, HttpServletResponse response, HttpServletRequest request) throws IOException;

    /**
     * 更新为空的分账、划付记录
     *
     * @param settleFileBo
     * @return
     */
    int updateNoneSettle(SettleFileBo settleFileBo);

    /**
     * 根据划付名称设置为清分失败
     * @param apprFileName
     */
    void setSettleError(String apprFileName);
}
